package com.hll.service.role;

import com.hll.mapper.RoleMapper;
import com.hll.pojo.Role;
import com.hll.utils.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author: Mr.Hu
 * @create: 2021-03-08 15:19
 */
public class RoleServiceImpl implements RoleService {
  private RoleMapper roleMapper;

  @Override
  public List<Role> getRoleList() {
    List<Role> roles = null;
    try (SqlSession sqlSession = MybatisUtil.getSqlSession()) {
      roleMapper = sqlSession.getMapper(RoleMapper.class);
      roles = roleMapper.getRoleList();
    }
    return roles;
  }
}
